//
//  TicketRecordCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/2/12.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "TicketRecordCell.h"
#import "NSDate+Extension.h"

@interface TicketRecordCell()
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;


@end

@implementation TicketRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setModel:(TicketRecordModel *)model
{
    _model = model;
    self.nameLab.text = model.clubCommodityName;
    self.timeLab.text = [NSString stringWithFormat:@"使用时间:%@",[self spToDateString:model.tripDate]];
}
- (NSString *)spToDateString:(NSString *)sp
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    formatter.dateFormat = @"YYYY年MM月dd日";
    
    NSDate *timeDate = [NSDate dateWithTimeIntervalSince1970:[sp floatValue]/1000];
    return [formatter stringFromDate:timeDate];
}

@end
